package com.rivulet.foreign.mapper;

import com.rivulet.foreign.pojo.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * {一句话形容此class功能}
 *
 * @author xujiac
 * @create 2021/6/3
 * @since 1.0.0
 */
@Component
public interface MessageMapper {
    /**
     * 查询所有信息
     *
     * @return
     */
    @Select("select * from t_message")
    public List<Message> getAllMessage();

    /**
     * 新增用户留言信息
     *
     * @param user_id
     * @param content
     * @param uptime
     */
    @Insert("insert into t_message (user_id,content,uptime) VALUES (#{user_id},#{content},#{uptime})")
    public void setMessage(@Param("user_id") String user_id, @Param("content") String content, @Param("uptime") Date uptime);

}
